<?php
	// simpan nilai variabel di form ke variabel penyimpanan di php	
	$username = $_POST['username'];
	$password = $_POST['password'];
	
	require_once('config.php');
	
	$sql="SELECT iduser FROM user WHERE username='$username' AND password='$password'";
	$result=mysql_query($sql);
	while($activeuser = mysql_fetch_array($result))
	{
		$res = $activeuser['iduser'];
	}
	
	if (!result) {
		die('Error : ' .mysql_error());
	}
	else{
		// Set Cookie User
		setcookie("id_active", $res);
		header("Location:".$url."home2.php");
	}
	
?>